import wx

EVT_WORK_STARTED = wx.NewId()
EVT_WORK_FINISHED = wx.NewId()

EVT_JOB_STARTED = wx.NewId()
EVT_JOB_FINISHED = wx.NewId()
EVT_JOB_SKIPPED = wx.NewId()
EVT_JOB_FAILED = wx.NewId()

EVT_GOTO_FIRST = wx.NewId()
EVT_GOTO_LAST = wx.NewId()
EVT_GOTO_NEXT = wx.NewId()
EVT_GOTO_PREVIOUS = wx.NewId()
EVT_GOTO_RANDOM = wx.NewId()

EVT_RECEIVED_FEED_INFO = wx.NewId()
EVT_NEW_UNREAD_ITEM = wx.NewId()


class Event(wx.PyEvent):
    """Simple event that allows for custom data"""
    
    def __init__(self, evt_type, data=None):
        wx.PyEvent.__init__(self)
        self.SetEventType(evt_type)
        self.data = data
        
        
def notify(evt_id, data=None, window=None):
    if window is None:
        window = wx.GetApp().GetTopWindow()
    wx.PostEvent(window, Event(evt_id, data))